home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / bbs_game / bang21.zip / BANG.SRC < prev    next >
Text File  |  1996-04-19  |  16KB  |  542 lines

  1. # ┌────────[ BANG Ver 2.1 - The Russian Roulette Credit Lottery ]────────────┐
  2. # │                                                                          │
  3. # │          Version:   2.1  (Released 14 Apr 1996) for SBBS 2.20 - Rev B    │
  4. # │           Author:   Robert Nykvist  aka  Chuckles@LAUGHBOX               │
  5. # │      Support BBS:   The Chuckle Box BBS  (334) 653-1888                  │
  6. # │                                                                          │
  7. # │      Quick Start:   1.  Move BANG.SRC to your \EXEC directory.           │
  8. # │                     2.  Edit to customize BANG.SRC as you see fit.       │
  9. # │                     3.  Compile BANG.SRC with BAJA compiler.             │
  10. # │                     4.  Make script available to your users.             │
  11. # │                                                                          │
  12. # │          WARNING:   This script changes user credits, uses file I/O      │
  13. # │                     to create a log, and will HANGUP on a user.          │
  14. # │                     Carefully check entire script for proper paths!      │
  15. # │                                                                          │
  16. # │              Original Script by:  Charles McColm (Oct 1995)              │
  17. # └──────────────────────────────────────────────────────────────────────────┘
  18. !INCLUDE SBBSDEFS.INC
  19. !INCLUDE FILE_IO.INC
  20.  
  21. # DEFINE VARIABLES
  22. # Counter Variable for Loops
  23. int COUNT
  24. # Chamber Variable.  Bullet is in this CHAMBER (1-6)
  25. int CHAMBER
  26. # Rounds Variable.  How many times to pull the Trigger (Rounds to shoot)
  27. int ROUNDS
  28. # Variable to keep track of Credit WINNINGS.
  29. int WINNINGS
  30. # Track Play Variable.  How many times did they play?
  31. int trackplay
  32. # File Variable - Keeps LOG of Victims.
  33. int FILE
  34. # Variable to get Time/Date
  35. int T
  36.  
  37. # Initialize Winnings & TrackPlay
  38. set WINNINGS 0
  39. set TRACKPLAY 0
  40.  
  41. # Top of Menu - Check for User Credits.
  42. :top
  43. CMD_HOME
  44. compare_ars $C !5
  45.   if_true
  46.     crlf
  47.     print "rhSorry, you don't have enough credits play today."
  48.     crlf
  49.     print "rhTry again tomorrow...n"
  50.     crlf
  51.     crlf
  52.     pause
  53.     cmd_pop
  54.     goto leave
  55.   end_if
  56.  
  57. # Display Menu
  58. cls
  59. crlf
  60. crlf
  61. print "nr                                ▀▄▀▄▀▄▀▄▀▄▀▄▀"
  62. crlf
  63. print "yh                                  TCB BANG!"
  64. crlf
  65. print "nr                                ▄▀▄▀▄▀▄▀▄▀▄▀▄"
  66. crlf
  67. crlf
  68. crlf
  69. print "hw                  Russian Roulette bv2.1 wby Chuckles@LAUGHBOX"
  70. crlf
  71. crlf
  72. print "hw                                                         <───n──┐"
  73. crlf
  74. print "               hr¡n                                               │"
  75. crlf
  76. print "               hr∙w              F - mFire Away  hk                  │"
  77. crlf
  78. print "hk               │w              I - cBANG Info hk                   │"
  79. crlf
  80. print "hk               │w              V - rView Victimshk                 │"
  81. # SysOp option to edit the BANG.LOG file.  Makes maintenance easy.
  82. compare_ars SYSOP
  83.   if_true
  84.     crlf
  85.     print "hk               │w              E - yEdit Log    hk                 │"
  86.   end_if
  87. crlf
  88. print "hk               │w              Q - gQuit to the BBS              r∙"
  89. crlf
  90. print "n               │hw                                               r¡"
  91. crlf
  92. print "n               └──wh──>"
  93.  
  94. # Get in Sync before getting user input
  95. node_action node_xtrn
  96. sync
  97.  
  98. # Get User Input
  99. getcmd efiqv?
  100.  
  101. # Re-display Menu
  102. cmdkey ?
  103.   cmd_pop
  104.   goto top
  105. end_cmd
  106.  
  107. # Quit BANG
  108. cmdkey q
  109.   cmd_pop
  110.   goto leave
  111. end_cmd
  112.  
  113. # View BANG.LOG
  114. cmdkey v
  115.   cls
  116.   crlf
  117.   print "hm───────────────────────────y│w5 Recent Bang Activity nhy│m───────────────────────────n"
  118.   crlf
  119.   chkfile "c:\sbbs\bang.log"
  120.     if_true
  121.       setstr "c:\\sbbs\\bang.log"
  122. # Only view last 16 lines.  (To avoid users getting angry at large logs)
  123.       printtail str 0 16
  124.       crlf
  125.     else
  126.       print "yh       No one has played yet, or the SysOp has screwed up somewhere."
  127.       crlf
  128.     end_if
  129.   print "hm──────────────────────────────────────────────────────────────────────────────n"
  130.   crlf
  131.   pause
  132.   cmd_pop
  133.   goto top
  134. end_cmd
  135.  
  136. # Info Menu.  Please give credit where credit is due.  Thanks.
  137. cmdkey i
  138.   cls
  139.   print "ònh   Chuckle Box BANG - Ver 2.1"
  140.   crlf
  141.   print "                     yfor SBBS 2.20 B, by Robert Nykvist"
  142.   crlf
  143.   print "c                    The Chuckle Box BBS @ (334) 653-1888"
  144.   crlf
  145.   crlf
  146.   print "hg     Just like Russian Roulette,y BANGg is a very stupid, high risk game!"
  147.   crlf
  148.   crlf
  149.   print "                    ncThis BBS's hy357 Magnum nchas hysix ncchambers."
  150.   crlf
  151.   crlf
  152.   print "ch                         Survive round 1:    +50 k"
  153.   crlf
  154.   print "                         Survive round 2:   +100 k"
  155.   crlf
  156.   print "                         Survive round 3:   +250 k"
  157.   crlf
  158.   print "                         Survive round 4:   +500 k"
  159.   crlf
  160.   print "                         Survive round 5:  +1000 k"
  161.   crlf
  162.   crlf
  163.   print "                                  nhirWARNINGn"
  164.   crlf
  165.   crlf
  166.   print "wh      If you pull trigger with bullet in a round, you lose Big Time!"
  167.   crlf
  168.   print "hm  -200 k rcredits."
  169.   print "hm   -30 rminutes from time bank."
  170.   print "  BBS thenm hangs-upr on you!"
  171.   crlf
  172.   crlf
  173.   print "ch             NEVER ncstick a gun to your head, or BBS.  <Chuckle>"
  174.   crlf
  175.   crlf
  176.   print "                               @PAUSE@"
  177.   cmd_pop
  178.   goto top
  179. end_cmd
  180.  
  181. # Edit Function for SysOp
  182. cmdkey E
  183.   compare_ars SYSOP
  184.     if_true
  185.       setstr "c:\\sbbs\\bang.log"
  186.       ungetstr
  187.       edit_text_file
  188.       cmd_pop
  189.       goto top
  190.     end_if
  191. end_cmd
  192.  
  193. # Fire the Gun. (PLAY GAME)   Initialize Variables.
  194. cmdkey f
  195.   set COUNT 0
  196.   set CHAMBER 0
  197.   set ROUNDS 0
  198.  
  199. # Use Random function to put bullet in this CHAMBER (1-6)
  200.   random CHAMBER 6
  201.   add CHAMBER 1
  202.   cls
  203.   crlf
  204.   print "yhLoading bOne yBullet into the Gun."
  205.   crlf
  206.   crlf
  207.   print "rhPull trigger how many times?y (w1-5y)r : "
  208.   sync
  209.  
  210. # How many times to pull trigger?  (Rounds to shoot)
  211.   getnum ROUNDS 5
  212.   crlf
  213.  
  214. # Pressing "Q" sometimes gave a "negative" (-1) number and
  215. # locked script in a non-stop loop.  This prevents negative number lockups.
  216.   compare ROUNDS 0
  217.     if_less_or_equal
  218.       cmd_pop
  219.       goto top
  220.     end_if
  221.  
  222. # Display formality - Send User "Time" or "Times?"
  223.   add TRACKPLAY 1
  224.   compare ROUNDS 1
  225.     if_true
  226.       printf "mhPulling triggery %1ld mtime..." ROUNDS
  227.       crlf
  228.       crlf
  229.       print "whAiming at gYOURh head @USER@, cocking hammer back...yReady?"
  230.       crlf
  231.       crlf
  232.       pause
  233.     else
  234.       printf "mhPulling triggery %1ld mtimes..." ROUNDS
  235.       crlf
  236.       crlf
  237.       print "whAiming at gYOUR whead @USER@, cocking hammer back...yReady?"
  238.       crlf
  239.       crlf
  240.       pause
  241.     end_if
  242.  
  243. # Pulls of the trigger compared to chamber with bullet in it.
  244. # If number of pulls IS LESS than the bullet chamber, user LIVES.
  245.   compare ROUNDS CHAMBER
  246.     if_less
  247. :LIVES
  248.  
  249. # Loop to display the number of rounds user shot.
  250.       compare COUNT ROUNDS
  251.         if_true
  252.           cmd_pop
  253.           goto doneloop
  254.         end_if
  255.       switch COUNT
  256.         case 0
  257. # Send remote caller an ASCII Bell for each shot fired & adjust credits.
  258. # You may wish to change the credit amounts here.  Be sure to change
  259. # the info menu to reflect any changes here.
  260.           print_remote ""
  261.           print "hrCLICK! ;; b(W h e w!)"
  262.           crlf
  263.           adjust_user_credits 50
  264.           add WINNINGS 50
  265.         end_case
  266.         case 1
  267.           print_remote ""
  268.           print "hgCLICK! ;; b(W h e w!  You are a brave person!)"
  269.           crlf
  270.           adjust_user_credits 100
  271.           add WINNINGS 100
  272.         end_case
  273.         case 2
  274.           print_remote ""
  275.           print "hyCLICK! ;; b(J e e s h!  Three rounds?  You gotta be nuts!)"
  276.           crlf
  277.           adjust_user_credits 250
  278.           add WINNINGS 250
  279.         end_case
  280.         case 3
  281.           print_remote ""
  282.           print "hcCLICK! ;; b(Y e o w!  4 squeezes?  You must wanna logoff!)"
  283.           crlf
  284.           adjust_user_credits 500
  285.           add WINNINGS 500
  286.         end_case
  287.         case 4
  288.           print_remote ""
  289.           print "hmCLICK! ;; b(W O W!  You got big nads or are suicidal!)"
  290.           crlf
  291.           adjust_user_credits 1000
  292.           add WINNINGS 1000
  293. # If User Pulls Trigger 5 times and Lives, Let's log it with special entry!
  294.           FOPEN file O_CREAT|O_WRONLY|O_APPEND "c:\sbbs\bang.log"
  295.             str one two three four
  296.             set one "hmCrazy w"
  297.             fprintf file "%s" one
  298.             fwrite file _useron.alias
  299.             set two " msurvived rhi5nhm clicks on y"
  300.             fprintf file "%s" two
  301.             int t
  302.             time t
  303.             time_str str t
  304.             shift_str 4
  305.             fprintf file "%s.\r\n" str
  306.           FCLOSE file
  307.         end_case
  308.  
  309.       end_switch
  310.  
  311.     crlf
  312.     pause
  313. # Adding one to COUNT - keeps track of which case feedback to send.
  314.     add COUNT 1
  315.     cmd_pop
  316.   goto LIVES
  317.  
  318.   else
  319.  
  320. # If the number of pulls equals or exceeds bullet chamber number, SPLAT!
  321.   :SPLAT
  322.  
  323. # Using Count Loop to determine WHEN to send the user their DEATH info.
  324.     add COUNT 1
  325.  
  326. # Only when count=chamber, bullet is in chamber, do we KILL the User!
  327.   compare COUNT CHAMBER
  328.     if_equal
  329.  
  330. # Note: Minute subtraction is from TIME bank, not present on-line time.
  331.         adjust_user_credits -200
  332.         sub WINNINGS 200
  333.         adjust_user_minutes -30
  334.  
  335. # Append Log with info of another Victim.
  336.       FOPEN file O_CREAT|O_WRONLY|O_APPEND "c:\sbbs\bang.log"
  337.         str one two five
  338.         set one "wh"
  339.         fprintf file "%s" one
  340.         fwrite file _useron.alias
  341.         set two " ncdied after mh"
  342.         fprintf file "%s" two
  343.         copy str trackplay
  344.         compare trackplay 1
  345.         if_equal
  346.           fprintf file "%s ncplay rh" str
  347.         else
  348.           fprintf file "%s ncplays rh" str
  349.         end_if
  350.         int t
  351.         time t
  352.         time_str str t
  353.         shift_str 4
  354.         fprintf file "%s" str
  355. # Determine Credit status.  Credit loses in Red.  Credit wins in White.
  356.         compare winnings 0
  357.           if_greater_or_equal
  358.             set five ".w  +"
  359.             fprintf file "%s" five
  360.             copy str winnings
  361.             fprintf file "%s k\r\n" str
  362.           else
  363.             set five ".r  "
  364.             fprintf file "%s" five
  365.             copy str winnings
  366.             fprintf file "%s k\r\n" str
  367.           end_if
  368.       FCLOSE file
  369.  
  370. # Use ARS security for salvation to valued callers.  <Chuckles>
  371.         compare_ars level 50
  372.           if_true
  373.             cmd_pop
  374.             goto lucky
  375.           end_if
  376.  
  377. # Anyone who plays Russian Roulette or BANG is plain Stoopid!
  378.         print "chBANG!  ;; r SPLAT... ;; g T,H,U,D,!"
  379.         crlf
  380.         crlf
  381.         print "ch,You bblewc your connection y@USER@! c Whadda rBloodyc Mess!"
  382.         crlf
  383.         crlf
  384.         print "hw,You have just fallen down and you can't get up.b  HaHa!"
  385.         crlf
  386.         crlf
  387.         print "hr,Confiscating earned credits, and taking 200 k more!b"
  388.         crlf
  389.         crlf
  390.         print "m,Subtracting y30 mminutes from your Time Bank if any was deposited!"
  391.         crlf
  392.         crlf
  393.         print "Call again...for some more fun!...gGoodbye for now..."
  394.         crlf
  395.         crlf
  396.         pause
  397.         hangup
  398.         cmd_pop
  399.         goto byebye
  400.       else
  401. # This loop is merely feedback to the User for each round shot, until
  402. # they reach the chamber with the bullet in it...
  403.         switch COUNT
  404.           case 1
  405.             print_remote ""
  406.             print "hrCLICK! ;; b(W h e w!)"
  407.             crlf
  408.           end_case
  409.           case 2
  410.             print_remote ""
  411.             print "hgCLICK! ;; b(W h e w!  You are a brave person!)"
  412.             crlf
  413.           end_case
  414.           case 3
  415.             print_remote ""
  416.             print "hyCLICK! ;; b(J e e s h!  Three rounds?  You gotta be nuts!)"
  417.             crlf
  418.           end_case
  419.           case 4
  420.             print_remote ""
  421.             print "hcCLICK! ;; b(Y e o w!  4 squeezes?  You must wanna logoff!)"
  422.             crlf
  423.           end_case
  424. # User should never be presented with Case 5, but I added it just in case.
  425.           case 5
  426.             print_remote ""
  427.             print "hmCLICK! ;; b(W O W!  You got big nads or you are suicidal!)"
  428.             crlf
  429.             print "\r\nyi*nhwBONUSyi* nch100k ncCredits!"
  430.             crlf
  431.           end_case
  432.         end_switch
  433.       crlf
  434.       pause
  435.       cmd_pop
  436.      goto SPLAT
  437. # Ending Compare/Count Chamber Loop
  438.     end_if
  439. # Ending Rounds Chamber Loop
  440.   end_if
  441.   cmd_pop
  442.   goto top
  443. # Ending Fire Command
  444. end_cmd
  445. # Fall through Just in Case
  446. cmd_pop
  447. goto top
  448.  
  449. # Done Loop - Send them feedback about their Credits.
  450. :doneloop
  451. compare COUNT 1
  452.   if_equal
  453.     print "chYou took a risk and mlived! c Congratulations!"
  454.     crlf
  455.     crlf
  456.     print "hgAddingy 50 k gCredits to your Account!"
  457.     crlf
  458.   end_if
  459. compare COUNT 2
  460.   if_equal
  461.     print "chYou took a BIG risk and msurvived! c Congratulations!"
  462.     crlf
  463.     crlf
  464.     print "hgAddingy 150 k gCredits to your Account!"
  465.     crlf
  466.   end_if
  467. compare COUNT 3
  468.   if_equal
  469.     print "chYou took a HUGE risk and mare still alive! c Congratulations!"
  470.     crlf
  471. # Credits are SUM TOTALS of each round shot.
  472.     crlf
  473.     print "hgAddingy 400 k gCredits to your Account!"
  474.     crlf
  475.   end_if
  476. compare COUNT 4
  477.   if_equal
  478.     print "chYou took a SUPER BIG risk and msurvived! c Congratulations!"
  479.     crlf
  480.     crlf
  481.     print "hgAddingy 900 k gCredits to your Account!"
  482.     crlf
  483.   end_if
  484. compare COUNT 5
  485.   if_equal
  486.     print "chYou took a AWESOME risk and mlived! c Congratulations!"
  487.     crlf
  488.     crlf
  489.     print "hgAddingy 1900 k gCredits to your Account!"
  490.     crlf
  491.   end_if
  492.   crlf
  493.   pause
  494. cmd_pop
  495. goto top
  496.  
  497. # For those Users with high enough security level to avoid the hangup.
  498. :lucky
  499.   print "chYou just rblewc your connection g@USER@! c But because of your high"
  500.   crlf
  501.   print "security level though, you were mNOTc disconnected from the BBS."
  502.   crlf
  503.   crlf
  504.   pause
  505. cmd_pop
  506. goto byebye
  507.  
  508. :leave
  509. # If TRACKPLAY equals 0, they didn't play.  No need to append the
  510. # BANG.LOG file for a user who didn't play.  Otherwise, log activity
  511. # which includes User, Times played, Date/Time, and Credit result info.
  512. compare trackplay 0
  513.   if_equal
  514.     cmd_pop
  515.     goto byebye
  516.   end_if
  517.   FOPEN file O_CREAT|O_WRONLY|O_APPEND "c:\sbbs\bang.log"
  518.     str uno dos
  519.     set uno "wh"
  520.     fprintf file "%s" uno
  521.     fwrite file _useron.alias
  522.     copy str trackplay
  523. # Display formality.  Time played, or Times played?
  524.     compare trackplay 1
  525.       if_equal
  526.         fprintf file "nc played mh%s nctime yh" str
  527.       else
  528.         fprintf file "nc played mh%s nctimes yh" str
  529.       end_if
  530.     int t
  531.     time t
  532.     time_str str t
  533.     shift_str 4
  534.     fprintf file "%s" str
  535.     set dos "nc.  Results: wh+"
  536.     fprintf file "%s" dos
  537.     copy str winnings
  538.     fprintf file "%s k\r\n" str
  539.   FCLOSE file
  540.  
  541. :byebye
  542.